package com.zx.link.service;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.zx.link.dao.LinkTypeDao;
import com.zx.link.entity.LinkType;
import java.util.List;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LinkTypeService {

    @Autowired
    private LinkTypeDao linkTypeDao;

    public List<LinkType> getAll() {
        List<LinkType> queryData = this.linkTypeDao.selectList(Wrappers.lambdaQuery());
        queryData = queryData.stream().sorted((l1, l2) -> l1.getOrderId().compareTo(l2.getOrderId()))
                .collect(Collectors.toList());
        return queryData;
    }

}
